package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author hm
 * @version 1.0
 * @date Created in 2024/7/13 15:23
 */
public interface CheckItemDao {
    /**
     * 新增体检检查项
     */
    @Insert("insert into t_checkitem (code,name,sex,age,price,type,remark,attention)  " +
            "values (#{code},#{name},#{sex},#{age},#{price},#{type},#{remark},#{attention})")
    void add(CheckItem checkItem);

    Page<CheckItem> findPage(String query);
    @Select("select * from t_checkitem where id = #{id}")
    CheckItem findById(Integer id);

    void update(CheckItem checkItem);
    @Delete("delete from t_checkitem where id = #{id}")
    void deleteById(Integer id);
    @Select("select checkgroup_id from t_checkgroup_checkitem where checkitem_id=#{id}")
    List<Integer> fingCheckgroupId(Integer id);
}
